<?php
/**
 *This file contains a pattern for Database connections
 *@author Muhammad El-Hindi <mu7eh7@googlemail.com>
 *6 Jun 2012
 *@copyright Copyright (c) 2012, Tuncay Bakan
 *@package lib
 *
 */
/**
 *Abstract class definition for DB connections
 *
 *package db_connection
 */
abstract class Dbconnection {
    /**
     * Connects to a database on a host
     *
     * @param String $sHost database host to which connection will be established
     * @param String $sUser database user to login to database host
     * @param String $sPassword password of the database user
     * @param String $sDatabase the database on host to connect to
     */
    abstract protected function connect($sHost, $sUser, $sPassword, $sDatabase);

    /**
     * Disconnects from the database to which has been connected before
     *
     */
    abstract protected function disconnect();

    /**
     * Validates query before use
     *
     * @param String $sQuery Query to validate
     */
    abstract protected function prepare($sQuery);

    /**
     * Performs query on database
     *
     * @param String $sQuery Query to be performed on database
     */
    abstract protected function query($sQuery="");

    /**
     * Fetchs a row in a specific type from the database
     *
     * @param String $sType The type in which the row should be returned
     */
    abstract protected function fetch($sType = 'object');

     


}
?>